package markgame2d.engine;

import java.awt.Image;
import java.awt.image.BufferedImage;
import java.util.HashMap;

public class MarkImageLoader {

	private HashMap<String, BufferedImage> images;
	
	public MarkImageLoader() {
		images = new HashMap<String, BufferedImage>();
	}
	
	public BufferedImage loadImage(String path){
		if(images.containsKey(path)){
			return images.get(path);
		}else{
			BufferedImage image = MarkGame.loadImage(path);
			images.put(path, image);
			return image;
		}
    }
	
	public void clear(){
		images.clear();
	}
	
}
